<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MCSManager 实例日志</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background: #f5f6fa;
            padding: 20px;
            color: #2c3e50;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            background: white;
            border-radius: 10px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }

        .header {
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid #eee;
        }

        .instance-info {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }

        .instance-icon {
            width: 48px;
            height: 48px;
            border-radius: 8px;
            background: #3498db;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            margin-right: 15px;
        }

        .instance-title {
            flex: 1;
        }

        .instance-name {
            font-size: 20px;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 5px;
        }

        .instance-id {
            font-size: 12px;
            color: #95a5a6;
        }

        .status-info {
            display: flex;
            gap: 15px;
            margin-bottom: 15px;
        }

        .status-item {
            display: flex;
            align-items: center;
        }

        .status-label {
            color: #7f8c8d;
            margin-right: 8px;
            font-size: 14px;
        }

        .status-value {
            font-size: 14px;
        }

        .status-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 12px;
            color: white;
            background: #95a5a6;
        }

        .status-running {
            background: #27ae60;
        }

        .status-stopped {
            background: #c0392b;
        }

        .status-starting {
            background: #f39c12;
        }

        .status-stopping {
            background: #d35400;
        }

        .status-busy {
            background: #8e44ad;
        }

        .log-container {
            background: #2c3e50;
            border-radius: 8px;
            padding: 15px;
            margin-top: 20px;
            overflow-x: auto;
        }

        .log-content {
            font-family: monospace;
            color: #ecf0f1;
            white-space: pre-wrap;
            font-size: 13px;
            line-height: 1.5;
        }

        .footer {
            margin-top: 20px;
            text-align: center;
            color: #95a5a6;
            font-size: 12px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="instance-info">
                <div class="instance-icon">
                    <%= instance.config.type.startsWith('minecraft') ? '⛏️' : 
                        instance.config.type.startsWith('steam') ? '🎮' : '📦' %>
                </div>
                <div class="instance-title">
                    <div class="instance-name"><%=instance.config.name%></div>
                    <div class="instance-id">ID: <%=instance.uuid%></div>
                </div>
            </div>
            <div class="status-info">
                <div class="status-item">
                    <div class="status-label">状态</div>
                    <div class="status-value">
                        <span class="status-badge <%=
                            instance.status === 3 ? 'status-running' : 
                            instance.status === 2 ? 'status-starting' :
                            instance.status === 1 ? 'status-stopping' :
                            instance.status === -1 ? 'status-busy' : 'status-stopped'
                        %>">
                            <%=instance.stateName%>
                        </span>
                    </div>
                </div>
                <div class="status-item">
                    <div class="status-label">日志大小</div>
                    <div class="status-value"><%=size%>KB</div>
                </div>
            </div>
        </div>

        <div class="log-container">
            <div class="log-content"><%=log%></div>
        </div>

        <div class="footer">
            Generated by Yunzai-Bot MCSManager Plugin
        </div>
    </div>
</body>
</html>
